package com.yst.metho.web.application.project;

import nextapp.echo2.app.event.ActionEvent;

import com.yst.metho.web.application.SuiviProdApp;
import com.yst.metho.web.application.components.ListingViewPane;
import com.yst.metho.web.application.interfaces.IItemViewWeb;
import com.yst.metho.web.application.project.actions.CloseProjectAction;
import com.yst.metho.web.application.project.actions.DeleteProjectAction;
import com.yst.metho.web.application.project.actions.OpenProjectAction;
import com.yst.metho.web.application.utils.ExceptionMgt;
import com.yst.suivi.data.rights.Right;

public class AdminProjectView extends IItemViewWeb
{
	public AdminProjectView()
	{
		super(Right.VIEW_ADMIN_PROJECT);
	}

	public void actionPerformed(ActionEvent arg0)
	{
		ListingViewPane listingView;
		try
		{
			ProjectListModel projectListModel = new ProjectListModel();
			listingView = new ListingViewPane(projectListModel, new ProjectTableCellRenderer(), true, true, new DeleteProjectAction(projectListModel), true, new CloseProjectAction(projectListModel), true, new OpenProjectAction(projectListModel));
			SuiviProdApp.getApp().changeWorkingArea(listingView);
		}
		catch (Throwable e)
		{
			ExceptionMgt.manage(e);
		}
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yst.metho.web.application.interfaces.IItemViewWeb#getCategory()
	 */
	public String getCategory()
	{
		return "Administration";
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.yst.metho.web.application.interfaces.IItemViewWeb#getName()
	 */
	public String getName()
	{
		return "Gestion des projets";
	}

}
